//
//  sprintf.c
//  柔性数组
//
//  Created by 马鹏朔 on 2022/11/2.
//

#include<stdio.h>
struct a{
    int a;
    int b;
    char arr[30];
};
int main()
{
    struct a s={18,20,"hellobit"};
    char a[100]={0};
    a[100]=sprintf(a,"%d %d %s",s.a,s.b,s.arr);
    printf("%s\n",a);
    struct a b={0};
    sscanf(a,"%d %d %s",&(b.a),&(b.b),b.arr);
    printf("%d %d %s",b.a,b.b,b.arr);
}
